﻿/* 11. Write an expression that extracts from a given integer i the value of a given bit number b. 
 * Example: i=5, b=2 --> value=1. */

using System;

public class TakeBitOnPosition
{
    public static void Main()
    {
        Console.Write("i = ");
        int i = int.Parse(Console.ReadLine());
        Console.Write("b = ");
        byte b = byte.Parse(Console.ReadLine());

        int value = (((1 << b) | i) == i) ? 1 : 0;
        Console.WriteLine("value = {0}", value);
    }
}